﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BattleShipLibrary
{
    public class Cell
    {
        private char cellValue = ' ';

        public char CellValue
        {
            get { return cellValue; }
            set { cellValue = value; }
        }
        private char X;

        public char _X
        {
            get { return X; }
            
        }
        private int Y;

        public int Y1
        {
            get { return Y; }
            
        }
        private bool CellShipp = false;

        public bool _CellShipp
        {
            get { return CellShipp; }
            set { CellShipp = value; }
        }
        private bool Shoted = false;

        public bool _Shoted
        {
            get { return Shoted; }
            set { Shoted = value; }
        }
        public Cell(char _X, int _Y)
        {
            X = _X;
            Y = _Y;

        }
        public Cell()
        {
            X = 'A';
            Y = '1';

        }
        public void Output(bool Enemy)
        {
            if (CellShipp == false && Shoted == false)
            {
                Console.BackgroundColor = ConsoleColor.Blue;
                Console.Write(cellValue);
            }

            if (CellShipp == true && Shoted == false)
            {
                if (Enemy == true)
                {
                    Console.BackgroundColor = ConsoleColor.Blue;
                    Console.Write(cellValue);
                }
                else
                {
                    Console.BackgroundColor = ConsoleColor.Green;
                    Console.Write(cellValue);
                }

            }
            if (CellShipp == false && Shoted == true)
            {
                cellValue = 'O';
                Console.BackgroundColor = ConsoleColor.Blue;
                Console.Write(cellValue);
            }
            if (CellShipp == true && Shoted == true)
            {
                cellValue = 'X';
                Console.BackgroundColor = ConsoleColor.Green;
                Console.Write(cellValue);
            }

        }

    }
}
